<form action="index.php?option=com_mail" method="post" name="adminForm" id="adminForm">
	
    <fieldset id="filter-bar">
    <table width="100%">
        <tr>
            <td>
            <div class="filter-search fltlft" style="width: 100%;">
    			<label class="filter-search-lbl" for="filter_search" style="line-height: 20px;font-size: 13px;">フィルタ&nbsp;</label>
    			<input type="text" name="filter_search" id="filter_search" value="<?php echo $this->list['filter_search']; ?>"/>
    			<button type="submit" class="btn">検索</button>
    			<button type="button" onclick="document.id('filter_search').value='';this.form.submit();">クリア</button>  		
    		</div>
            </td>
            <td width="200">
                <label style="line-height: 20px;font-size: 13px;"> ステータス&nbsp;</label> 
                <?php 
                // we have three status : 1 save draft, 2 waiting schedule, 3 sent
                $status = array('全て', '一時保存', '予約済み', '配信済み');
                echo JHTML::_('Select.genericlist',$status,"status",'onchange="this.form.submit()"',null,null,$this->list['status']);
                ?>	
            </td>
        </tr>
    </table>
		
	</fieldset>
	<div class="clr"> </div>

	<table class="adminlist" width="100%">
		<thead>
			<tr>
				<th width="1%">
					<input type="checkbox" name="checkall-toggle" value="" title="Check All" onclick="Joomla.checkAll(this)"/>
				</th>
				<th width="5%">
									
                </th>
				<th>
					<label class="labelth">件名</label>				
                </th>
				<th width="20%">
					 <label class="labelth">送信先</label>     				
                </th>
				<th width="5%">
					<label class="labelth">送信者</label>      			
                </th>
				<th width="15%">
				    <label class="labelth">送信日</label>       
                </th>
				
			</tr>
		</thead>
		<tfoot>
			<tr>
				<td colspan="15">
				    <?php echo $this->pagination->getListFooter(); ?>	
                </td>
			</tr>
		</tfoot>
		<tbody>
          <?php foreach($this->rows as $k=>$row):
                $row->MAMA_MAGR_CODE2 = $row->MAMA_MAGR_CODE;
                
                // get 50 char
                if(strlen($row->MAMA_MAGR_CODE2)>50) 
                    $row->MAMA_MAGR_CODE = substr($row->MAMA_MAGR_CODE2,0,50).'...';
                
                // type : 1 draft, 2 wait, 3 sent
                if($row->MAMA_FLAG == 1) {
                    $row->MAMA_FLAG = 'save';
                }elseif($row->MAMA_FLAG == 2) {
                    $row->MAMA_FLAG = 'wait';
                }else $row->MAMA_FLAG = 'sent'; ?>
                
    		  <tr class="row<?php echo $k%2?>">
    			<td class="center">
                    <input type="checkbox" id="cb<?php echo $row->MAMA_CODE ?>" name="cid[]" value="<?php echo $row->MAMA_CODE ?>" onclick="Joomla.isChecked(this.checked);"/>
                </td>
    			<td><img src="components/com_mail/public/images/<?php echo $row->MAMA_FLAG ?>.png"/></td>
    			<td> <a href="index.php?option=com_mail&task=edit&cid=<?php echo $row->MAMA_CODE ?>">
                    <?php echo $row->MAMA_TITLE ?></a>
                </td>
                <td><?php echo $row->MAMA_MAGR_CODE ?></td>
                <td class="center"><?php echo $row->MAMA_SENDER ?></td>
                <td class="center"><?php echo $row->MAMA_DATETIME ?></td>
    		  </tr>
          <?php endforeach ?>
		</tbody>
	</table>

		

	<div>
		<input type="hidden" name="task" value=""/>
		<input type="hidden" name="boxchecked" value="0"/>
    </div>
</form>
<script>
Joomla.submitbutton = function(task){
	   if(task == 'remove'){
	       if(!confirm('選択したデータを削除します。よろしいですか？')){
	           return false;
	       }
	   }
       
       Joomla.submitform(task, document.getElementById('adminForm'));
       
 }
</script>